<!DOCTYPE html>
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="renderer" content="webkit" />
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>{:get_system_config('web','admin_title')}</title>
	<link rel="stylesheet" href="{__CSS__}/student.css" />	
	<link rel="stylesheet" href="{__GOUGU__}/layui/css/layui.css" />
	
</head>

<body>
	<div id="container">
		<canvas id="canvas" width="2560" height="1292"></canvas>
		<div class="login">
			<div class="wrap">
			{//右边栏目开始}

				<div class="login-logo"><a href="/"><img src="{__IMG__}/student_login_logo.png"></a></div>
				
					<div class="account-login">
						<div class="form-box">
							<form id="studentLogin" class="layui-form">
								<div class="form-item">	
									
									<select name="bj_name" id="bj_name" lay-filter="bjFilter" class="login-input">
									<option value="">请选择班级</option>
									{volist name="bj_list" id="v"}
									<option value="{$v.bj_name}">{$v.bj_name}</option>
									{/volist}
								</select>
									
								</div>
								<div class="form-item">
									<select name="st_name" id="st_name" class="login-input" lay-filter="stnameFilter">
									<option value="">请选择学生</option>
									
								</select>
									
								</div>
								<div class="form-item">
									<input type="password" name="password" placeholder="密码" autocomplete="off" class="login-input">
								</div>
								<div class="form-item">
									<div style="width:140px;display:inline-block;">
										<input type="text" name="captcha" placeholder="验证码" autocomplete="off" class="login-input" style="width: 140px;">
									</div>
									<div class="captcha-img">
										{:captcha_img()}
										<input type="hidden" value="{:make_token()}" />
									</div>
								</div>
								<div class="form-item">
									<button id="loginSubmit" type="button" class="login-btn">登录</button>
								</div>
							</form>
							<div class="footer-operation">
								<p><a>忘记密码？请联系班主任老师查询！</a></p>
								
							</div>
						</div>
					</div>
				
			
			</div>
		</div>
		<div class="foot">
			{:get_system_config('web','copyright')} <a id="beian" href="//www.ttxwgyxx.cn" target="_blank"
				rel="nofollow" style="margin-left: 12px;color:#458BF3">{:get_system_config('web','icp')}</a>，Powered by GouguCMS
		</div>
	</div>
	<script language="javascript" src="{__JS__}/jquery.min.js"></script>
	<script language="javascript" src="{__JS__}/layer/layer.js"></script>
	<script src="{__GOUGU__}/layui/layui.js"></script>	
	<script type="text/javascript">
		var canvas=document.querySelector("#canvas"),ctx=canvas.getContext("2d");canvas.width=window.innerWidth,canvas.height=window.innerHeight,ctx.lineWidth=.3,ctx.strokeStyle=new Color(150).style;var movePos={x:30*canvas.width/100,y:30*canvas.height/100},dots={nb:250,distance:100,d_radius:150,array:[]};function colorValue(t){return Math.floor(255*Math.random()+t)}function createColorStyle(t,o,i){return"rgba("+t+","+o+","+i+", 0.618)"}function mixComponents(t,o,i,a){return(t*o+i*a)/(o+a)}function averageColorStyles(t,o){var i=t.color,a=o.color,s=mixComponents(i.r,t.radius,a.r,o.radius),n=mixComponents(i.g,t.radius,a.g,o.radius),e=mixComponents(i.b,t.radius,a.b,o.radius);return createColorStyle(Math.floor(s),Math.floor(n),Math.floor(e))}function Color(t){t=t||0,this.r=colorValue(t),this.g=colorValue(t),this.b=colorValue(t),this.style=createColorStyle(this.r,this.g,this.b)}function Dot(){this.x=Math.random()*canvas.width,this.y=Math.random()*canvas.height,this.vx=-.5+Math.random(),this.vy=-.5+Math.random(),this.radius=3*Math.random(),this.color=new Color}function createDots(){for(i=0;i<dots.nb;i++)dots.array.push(new Dot)}function moveDots(){for(i=0;i<dots.nb;i++){var t=dots.array[i];t.y<0||t.y>canvas.height?(t.vx=t.vx,t.vy=-t.vy):(t.x<0||t.x>canvas.width)&&(t.vx=-t.vx,t.vy=t.vy),t.x+=t.vx,t.y+=t.vy}}function connectDots(){for(i=0;i<dots.nb;i++)for(j=0;j<dots.nb;j++)i_dot=dots.array[i],j_dot=dots.array[j],i_dot.x-j_dot.x<dots.distance&&i_dot.y-j_dot.y<dots.distance&&i_dot.x-j_dot.x>-dots.distance&&i_dot.y-j_dot.y>-dots.distance&&i_dot.x-movePos.x<dots.d_radius&&i_dot.y-movePos.y<dots.d_radius&&i_dot.x-movePos.x>-dots.d_radius&&i_dot.y-movePos.y>-dots.d_radius&&(ctx.beginPath(),ctx.strokeStyle=averageColorStyles(i_dot,j_dot),ctx.moveTo(i_dot.x,i_dot.y),ctx.lineTo(j_dot.x,j_dot.y),ctx.stroke(),ctx.closePath())}function drawDots(){for(i=0;i<dots.nb;i++){dots.array[i].draw()}}function runDots(){ctx.clearRect(0,0,canvas.width,canvas.height),moveDots(),connectDots(),drawDots(),requestAnimationFrame(runDots)}Dot.prototype={draw:function(){ctx.beginPath(),ctx.fillStyle=this.color.style,ctx.arc(this.x,this.y,this.radius,0,3*Math.PI,!1),ctx.fill()}};var can=document.querySelector("#canvas");can.addEventListener("mousemove",function(t){movePos.x=t.pageX,movePos.y=t.pageY}),can.addEventListener("mouseleave",function(t){movePos.x=canvas.width/2,movePos.y=canvas.height/2}),createDots(),requestAnimationFrame(runDots);

		 layui.use('form', function() {

          var $ = layui.$,
           form=layui.form;
        //事件监听
        form.on('select(bjFilter)', function(data){
        	// console.log(data);
        	
            var val=data.value;
               $.ajax({
            	method: "post",//传输方式
                url:"{:url('home/student/dochangebj')}",
                dataType : 'json',
                data:{"bj_name":val},
                success : function(data) {
                	//console.log(data.data);
                	// alert(data);
                	 $('#st_name option').empty();
                        var st_name_select = '';
                        for (var o in data) {
                            st_name_select += '<option value="' + data[o].st_name + '">'  + data[o].code+ data[o].st_name + '</option>';
                        }
                        $('#st_name').html(st_name_select);
                        form.render('select');
                    },
                	
                	//返回数据失败
                    error: function () {
                        alert("班级选择错误，请稍后重试！");
                    }

            });
            
            });
        });

$('#loginSubmit').on('click', function () {
			$.ajax({
				url: "/home/student/login_submit",
				data: $('#studentLogin').serialize(),
				type: 'post',
				async: false,
				success: function (res) {
					layer.msg(res.msg);
					if (res.code === 0) {
						setTimeout(function () {
							window.location.href="{:url('/home/student/index')}";
						}, 1500);
					} else {
						$('[alt="captcha"]').click();
					}
				}
			})
		});

	</script>

</body>

</html>
